From 85fa3961761c7d3a39570b83f5212751e1651519 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Timm=20B=C3=A4der?= Date: Thu, 4 Jan 2018 18:25:55 +0100 Subject: [PATCH] widget: Avoid casting event coordinates to int in contains() --- gtk/gtkwidget.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/gtk/gtkwidget.c b/gtk/gtkwidget.c index 02e651a9a7..af4b3c7ae3 100644 --- a/gtk/gtkwidget.c +++ b/gtk/gtkwidget.c @@ -911,11 +911,14 @@ gtk_widget_real_contains (GtkWidget *widget, gdouble y) { GtkAllocation own_alloc; + graphene_rect_t widget_bounds; gtk_widget_get_own_allocation (widget, &own_alloc); - + graphene_rect_init (&widget_bounds, own_alloc.x, own_alloc.y, own_alloc.width, own_alloc.height); + /* XXX: This misses rounded rects */ - return gdk_rectangle_contains_point (&own_alloc, x, y); + return graphene_rect_contains_point (&widget_bounds, + &(graphene_point_t){x, y}); } static GtkWidget * -- 2.30.2